<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商品基本信息管理-后台管理系统</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/admin/css/css.css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/admin/js/jquery.min.js"></script>
<!-- <script type="text/javascript" src="js/page.js" ></script> -->
</head>

<body>
	<div id="pageAll">
		<div class="pageTop">
			<div class="page">
				<img src="${pageContext.request.contextPath}/admin/img/coin02.png" /><span><a href="#">首页</a>&nbsp;-&nbsp;-</span>&nbsp;商品基本信息管理
			</div>
		</div>

		<div class="page">
			<!-- user页面样式 -->
			<div class="connoisseur">
				<!-- user 表格 显示 -->
				<div class="conShow">
					<table border="1" cellspacing="0" cellpadding="0">
						<tr>
							<td width="66px" class="tdColor tdC">序号</td>
							<td width="300px" class="tdColor">管理员账号</td>
							<td width="200px" class="tdColor">密码</td>
							<td width="100px" class="tdColor">部门</td>
							<td width="130px" class="tdColor">职务</td>
							<td width="230px" class="tdColor">单位名称</td>
							<td width="266px" class="tdColor">地址</td>
							<td width="235px" class="tdColor">手机</td>
							<td width="200px" class="tdColor">邮箱</td>
							<td width="200px" class="tdColor">QQ</td>
							<td width="130px" class="tdColor">操作</td>
						</tr>
						<c:forEach var="admin" items="${sessionScope.admins}">
							<tr>
								<td style="width:265px;">${admin.id}</td>
								<td>${admin.admin}</td>
								<td>${admin.password}</td>
								<td>${admin.department}</td>
								<td>${admin.name}</td>
								<td>${admin.organization}</td>
								<td>${admin.address}</td>
								<td>${admin.phone}</td>
								<td>${admin.email}</td>
								<td>${admin.qq}</td>
								<%--&PR=${admin.productNum}&NA=${admin.name}&PR=${admin.price}&DI=${admin.discountPrice}&IM=${admin.img}&${admin.discount}&${admin.status}&${admin.type}&${admin.fitGrade}&${admin.author}&${admin.publishHouse}&${admin.publishDate}&${admin.integral}&${admin.uploadTime}--%>
								<td><a href="adminUpdate.jsp?ID=${admin.id}">
										<img class="operation" src="img/update.png">
									</a>
									<%--<a href="${pageContext.request.contextPath}/admin?method=deleteadmin&?id=${admin.id}&admin=admin}">--%>
									<img class="operation delban" src="img/delete.png" onclick="dj('${admin.admin}')">
										<%--suppress CheckValidXmlInScriptTagBody --%>
								</td>
							</tr>

						</c:forEach>
					</table>

					<div class="paging">
                        <table>
                            <tr>
								<c:if test="${sessionScope.countPage > 1}">
									<a href="${pageContext.request.contextPath }/admins?method=findByPage&pageIndex=${sessionScope.countPage-1}">上一页</a>
								</c:if>
								<c:if test="${sessionScope.countPage <= 1}">
								<a style="background-color:gray;">上一页</a>
								</c:if>

								<c:forEach begin="1" end="${sessionScope.adminPage}" varStatus="v">
									<a href="${pageContext.request.contextPath }/admins?method=findByPage&pageIndex=${v.count}">${v.count} &nbsp;</a>
								</c:forEach>

								<c:if test="${sessionScope.countPage < sessionScope.adminPage }">
									<a href="${pageContext.request.contextPath }/admins?method=findByPage&pageIndex=${sessionScope.countPage+1}">下一页</a>
								</c:if>
								<c:if test="${sessionScope.countPage >= sessionScope.adminPage}">
								<a style="background-color:gray;">下一页</a>
								</c:if>
                            </tr>
                        </table>
                    </div>
				</div>
				<!-- user 表格 显示 end-->
			</div>
			<!-- user页面样式end -->
		</div>

	</div>


	<!-- 删除弹出框 -->
	<div class="banDel">
		<div class="delete">
			<div class="close">
				<a><img src="img/shanchu.png" /></a>
			</div>
			<p class="delP1">你确定要删除此条记录吗？</p>
			<p class="delP2">
				<a href="" id="aSub" class="ok yes">确定</a><a class="ok no">取消</a>
			</p>
		</div>
	</div>
<%--suppress CheckValidXmlInScriptTagBody --%>
	<script>
        function dj(id) {
            document.querySelector("#aSub").href = "${pageContext.request.contextPath}/admins?method=deleteAdmin&admin="+id;
        }
	</script>
	<!-- 删除弹出框  end-->
</body>

<script type="text/javascript">
// 广告弹出框
$(".delban").click(function(){
  $(".banDel").show();
});
$(".close").click(function(){
  $(".banDel").hide();
});
$(".no").click(function(){
  $(".banDel").hide();
});
// 广告弹出框 end
</script>
</html>